//
//  LGThirdPartyLoginManager.h
//  LGAuthentication
//
//  Created by b233 on 16/8/11.
//  Copyright © 2016年 LGCloudPlatform. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WeiboSDK.h"
#import "WXApi.h"

typedef NS_ENUM(NSInteger, LGThirdLoginType) {
    LGThirdLoginTypeWeiBo = 0,   // 新浪微博
    LGThirdLoginTypeTencent,      // QQ
    LGThirdLoginTypeWeiXin       // 微信
};

typedef NS_ENUM(NSInteger, LGLoginWeiXinErrCode) {
    LGLoginWeiXinErrCodeSeccess = 0,
    LGLoginWeiXinErrCodeCancel = 2,
};

typedef void (^LGTHirdPartyResultBlock)(NSDictionary *LoginResult, NSString *error);


// 传递获取到的第三方登录平台
@protocol LGThirdPartyLoginManagerDelegate <NSObject>

- (void)getThirdPartyPlatformWithArray:(NSMutableArray *)array;

@end


@interface LGThirdPartyLoginManager : NSObject<WeiboSDKDelegate,WXApiDelegate>

@property (nonatomic,weak) id<LGThirdPartyLoginManagerDelegate>platformDelegate;

// 从keychain中获取第三方配置信息,从网络获取数据
- (void)configAppWithParamsWithKeyChain;

+ (instancetype)shareLGThirdPartyLoginManager;

+ (void)getUserInfoWithLGLoginType:(LGThirdLoginType)type result:(LGTHirdPartyResultBlock)result;

@end
